﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Entry;

namespace COFE.Core.Actions
{
    /// <summary>
    /// Entrylist with only one entry, used in Action polling.
    /// </summary>
    public class OneEntryList : EntryListBase, IOneEntryList
    {
        public OneEntryList(Guid id, IFileSystemInfo entry)    
            : base(id, "", null)
        {
            Entry = entry;            
        }

        public OneEntryList(IFileSystemInfo entry)
            : this(Guid.NewGuid(), entry)
        {
         
        }

        #region Methods

        public void InsertRange(int index, IEnumerable<IFileSystemInfo> entries)
        {
            throw new NotSupportedException();
        }

        public void Delete(Filter.IEntryFilter[] matchFilter)
        {
            throw new NotSupportedException();
        }

        #endregion

        #region Data

        #endregion

        #region Public Properties

        public IFileSystemInfo Entry { get; set; }         
        
        public override IEnumerable<IFileSystemInfo> Entries { get { return new List<IFileSystemInfo>() { Entry as IInternalFileSystemInfoExA };; } }

        public IEnumerable<IInternalFileSystemInfoExA> InternalEntries { get { return new List<IInternalFileSystemInfoExA>() { Entry as IInternalFileSystemInfoExA }; } }

        #endregion
    }
}
